<?php
/*** 
 * @开源软件: 店滴AI-基于AI的软硬件开源解决方案
 * @官方地址: http://www.wayfirer.com/
 * @版本: 1.0
 * @邮箱: 2192138785@qq.com
 * @作者: Wang Chunsheng
 * @Date: 2020-02-28 22:38:37
 * @LastEditTime: 2020-04-25 23:07:16
 */
/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-27 19:51:59
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-03-27 19:52:53
 */
 


namespace common\addons\diandi_shop\backend;

use Yii;
use common\addons\diandi_shop\models\DdGoods;
use backend\controllers\BaseController;
use common\helpers\ImageHelper;

/**
 * DefaultController
 *
 * @author Misbahul D Munir <misbahuldmunir@gmail.com>
 * @since 1.0
 */
class DefaultController extends BaseController
{
    
    // public $layout = "@backend/views/layouts/plugins-base";
    /**
     * Action index
     */
    public function actionIndex()
    {
        $goods = DdGoods::findOne(['goods_id' => '10262']);
        $info = Yii::$app->settings->getAllBySection('DiandiShopStroe');
        $info['logo'] = ImageHelper::tomedia($info['logo']);
        $info['banner'] = ImageHelper::tomedia($info['banner']);
        $info['wxappName'] = Yii::$app->settings->get('Wxapp', 'name');
        $wxappHeadimg = Yii::$app->settings->get('Wxapp', 'headimg');
        $info['wxappHeadimg'] = ImageHelper::tomedia($wxappHeadimg);

        return $this->render('index',[
            'info'=>$info
        ]);
    }
}
